import type { FormRules } from "naive-ui";
import { requiredRule, REGEXP_PWD } from "@/utils";

export interface Props {
  data?: User;
}
export interface Emits {
  (e: "submitSuccess"): void;
}

export const formRules: FormRules = {
  nickname: requiredRule("请输入用户名称"),
  account: requiredRule("请输入用户标识"),
  password: [
    requiredRule("请输入用户密码"),
    {
      pattern: REGEXP_PWD,
      message: "密码为6-18位数字/字符/符号，至少2种组合",
      trigger: "input",
    },
  ],
};
